
Ext.require([
    'Ext.window.MessageBox',
	'Ext.panel.Panel',
	'Ext.form.Panel',
    'Ext.tip.*'
]);




Ext.onReady(function(){
	
	/*
//IP validation
var ipaddresstest = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
	Ext.apply(Ext.form.field.VTypes, {
	    IPAddress:  function(v) {
	        return ipaddresstest.test(v);
	    },
	    IPAddressText: 'Must be a numeric IP address',
	    IPAddressMask: /[\d\.]/i
	});
*/
	
	//for company lookup
	Ext.define('CompanyLK', {
		extend: 'Ext.data.Model',
		fields: [{
			name: 'companycode',
			type: 'string'
		},{
			name: 'companyname',
			type: 'string'
		}]
	});	
	//for department lookup
	Ext.define('DepartmentLK', {
		extend: 'Ext.data.Model',
		fields: [{
			name: 'departmentcode',
			type: 'string'
		},{
			name: 'departmentname',
			type: 'string'
		}]
	});	
	//for position
	Ext.define('PositionLK', {
		extend: 'Ext.data.Model',
		fields: [{
			name: 'positioncode',
			type: 'string'
		},{
			name: 'positionname',
			type: 'string'
		}]
	});	
    var companylk =	Ext.create('Ext.data.Store', {
						model: 'CompanyLK',
						proxy: {
							type: 'ajax',
							url: 'data/exitinterview/company.json',
							reader: {
								type: 'json',
								root: 'companylk'
							}
							
						},
						autoLoad: true
					    
				   });
    var departmentlk =	Ext.create('Ext.data.Store', {
						model: 'DepartmentLK',
						proxy: {
							type: 'ajax',
							url: 'data/exitinterview/departmentlk.json',
							reader: {
								type: 'json',
								root: 'departmentlk'
							}
							
						},
						autoLoad: true
					    
				   });
		
    var positionlk =	Ext.create('Ext.data.Store', {
							model: 'PositionLK',
							proxy: {
								type: 'ajax',
								url: 'data/exitinterview/positionlk.json',
								reader: {
									type: 'json',
									root: 'positionlk'
								}
								
							},
							autoLoad: true
						    
					   });
	
var formExit =  Ext.create('Ext.form.Panel', {
  	title: 'Exit Interview',
	titleAlign: 'center',
    width: '100%',
    height: 2700,
    layout: {
        type: 'vbox',
        align: 'center'
    },
    renderTo: document.body,
    items: [{
        xtype: 'panel',
        width: '60%',
        flex: 6,
		layout: {
			type: 'hbox',
			align: 'stretch'
		},
		items: [{
			xtype: 'panel',
			flex: 7
		},{
			xtype: 'panel',
			flex: 4,
			items: [{
				fieldLabel: 'Control Number',
				name: 'controlnumber',
				allowBlank: false,
				xtype: 'textfield',
				cls: 'field-margin',
			},{
				fieldLabel: 'Company',
				name: 'company',
				allowBlank: false,
				xtype: 'combobox',
				cls: 'field-margin',
				store: companylk,
				displayField: 'companyname',
				valueField: 'companycode'
			},{
				fieldLabel: 'Date of Accomplishment',
				allowBlank: false,
				name: 'dateofaccomplishment',
				value: new Date(),
				xtype: 'datefield',
				cls: 'field-margin',
			}]

		}]
		
    },{
        xtype: 'panel',
        width: '60%',
        flex: 15,
		layout: {
			type: 'hbox',
			align: 'stretch'
		},
		items: [{
			xtype: 'panel',
			flex: 1,
			items: [{
				fieldLabel: 'Name of Employee',
				name: 'nameofemployee',
				allowBlank: false,
				xtype: 'textfield',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300,
				vtype: 'alpha'
			},{
				fieldLabel: 'Employee Number',
				allowBlank: false,
				name: 'employeenumber',
				xtype: 'textfield',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300,
				listeners: {
					blur: function( thiss, The, eOpts ) {
						var parentForm = thiss.up('form');
						var formValues = parentForm.getValues();
						
						formExit.getForm().load({
							url: 'app/controller/testload.cfm',
							method: 'post',
							params: {
								employeeid: formValues.company
							},
							//waitMsg: 'Updating form, please wait...',
							//waitTitle: 'Updating...',
							failure: function(form, action){
					  			Ext.Msg.show({
					  				title: 'Failed to update',
					  				msg: 'There is a problem in getting the exit interview form data.' + action.result.form[0].detail,
					  				buttons: Ext.Msg.OK,
					  				icon: Ext.Msg.ERROR
					  			});
					  		},
					  		success: function(form, action){
					  			//Ext.Msg.alert('Status', 'Form loaded successfully.');
					  		}
						});
					}
				}
			},{
				fieldLabel: 'Immediate Superior',
				//allowBlank: false,
				name: 'immediatesuperior',
				xtype: 'textfield',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300
			},{
				fieldLabel: 'Department',
				allowBlank: false,
				name: 'department',
				xtype: 'combobox',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300,
				store: departmentlk,
				displayField: 'departmentname',
				valueField: 'departmentcode'
			},{
				fieldLabel: 'Age',
				allowBlank: false,
				name: 'age',
				xtype: 'numberfield',
				cls: 'field-margin',
				labelAlign: 'top',
				value: 0,
				minValue: 0,
				maxValue: 99,
				width: 300
			}]
		},{
			xtype: 'panel',
			flex: 1,
			items: [{
				fieldLabel: 'Current Position',
				allowBlank: false,
				name: 'currentposition',
				xtype: 'combobox',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300,
				store: positionlk,
				displayField: 'positionname',
				valueField: 'positioncode'
			},{
				fieldLabel: 'Position Upon Hire',
				name: 'positionuponhire',
				xtype: 'combobox',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300,
				store: positionlk,
				displayField: 'positionname',
				valueField: 'positioncode'
			},{
				fieldLabel: 'Date Hired',
				name: 'datehired',
				xtype: 'datefield',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300
			},{
				fieldLabel: 'Effective Date of Resignation',
				name: 'effectdateresign',
				xtype: 'datefield',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300
			},{
				fieldLabel: 'Length of Service',
				name: 'lengthofservice',
				xtype: 'textfield',
				cls: 'field-margin',
				labelAlign: 'top',
				width: 300
			}]
		}]
    },{
        xtype: 'panel',
        width: '60%',
        flex: 5,
		items: [{
			
			xtype: 'displayfield',
			width: 600,
			cls: 'field-margin',
			name: 'displayonly',
			value: 'The Company appreciates your efforts in answering these questions frankly.  Rest assured that your answers would not in any way affect the processing and release of your clearances and final pay.  Your truthful answers would help the Company improve its services to the employees.  This questionnaire will be treated with utmost confidentiality.'
		}]
    },{
        xtype: 'panel',
        title: 'REASONS FOR LEAVING',
        width: '60%',
        flex: 21,
		items: [{
			xtype: 'displayfield',
			width: 500,
			cls: 'field-margin',
			name: 'displayonlytwo',
			value: 'Please check the item that corresponds to your answer.'
		},{
			xtype: 'displayfield',
			width: 500,
			cls: 'field-margin',
			name: 'displayonlythree',
			value: '  '
		},{
			xtype: 'displayfield',
			width: 500,
			cls: 'field-margin',
			name: 'displayonlyfour',
			value: '1.	What is the main factor that affected your decision to leave the Company?'
		},{
			xtype: 'checkboxgroup',
			name: 'factorleavecompany',
			//allowBlank: false,
			//labelAlign: 'top',
			//fieldLabel: 'Test',
			cls: 'field-margin',
			columns: 4,
			vertical: true,
			items: [{
				boxLabel: 'Local Job Opportunity',
				name: 'localopportunity',
				inputValue: 'Local Job Opportunity',
				value: 'Local Job Opportunity',
				width: 170
			},{
				boxLabel: 'Overseas Job Opportunity',
				name: 'localopportunity',
				inputValue: 'Overseas Job Opportunity',
				width: 190
			},{
				boxLabel: 'Salary',
				name: 'localopportunity',
				inputValue: 'Salary',
				width: 170
			},{
				boxLabel: 'Benefits',
				name: 'localopportunity',
				inputValue: 'Benefits',
				width: 170
			},{
				boxLabel: 'Career Growth',
				name: 'localopportunity',
				inputValue: 'Career Growth',
				width: 170
			},{
				boxLabel: 'Nature of Job',
				name: 'localopportunity',
				inputValue: 'Nature of Job',
				width: 170
			},{
				boxLabel: 'Relationship with Superior',
				name: 'localopportunity',
				inputValue: 'Relationship with Superior',
				width: 190
			},{
				boxLabel: 'Relationship with Co-workers',
				name: 'localopportunity',
				inputValue: 'Relationship with Co-workers',
				width: 200
			},{
				boxLabel: 'Company Systems',
				name: 'localopportunity',
				inputValue: 'Company Systems',
				width: 170
			},{
				boxLabel: 'Company Atmosphere',
				name: 'localopportunity',
				inputValue: 'Company Atmosphere',
				width: 170
			},{
				boxLabel: 'Studies',
				name: 'localopportunity',
				inputValue: 'Studies',
				width: 170
			},{
				boxLabel: 'Put up own business',
				name: 'localopportunity',
				inputValue: 'Put up own business',
				width: 170
			},{
				boxLabel: 'Health',
				name: 'localopportunity',
				inputValue: 'Health',
				width: 170
			},{
				boxLabel: 'Family',
				name: 'localopportunity',
				inputValue: 'Family',
				width: 170
			},{
				boxLabel: 'Migration/Relocation',
				name: 'localopportunity',
				inputValue: 'Migration/Relocation',
				width: 170
			},{
				boxLabel: 'Proximity',
				name: 'localopportunity',
				inputValue: 'Proximity',
				width: 170
			},{
				boxLabel: 'Work Load',
				name: 'localopportunity',
				inputValue: 'Work Load',
				width: 170
			},{
				boxLabel: 'Work Schedule',
				name: 'localopportunity',
				inputValue: 'Work Schedule',
				width: 170
			},{
				boxLabel: 'Working Conditions (Safety, Work Space, Equipment)',
				name: 'localopportunity',
				inputValue: 'Working Conditions (Safety, Work Space, Equipment)',
				width: 270
			}]
		},{
			xtype: 'displayfield',
			width: 500,
			cls: 'field-margin',
			name: 'displayonlyfive',
			value: '2.	For Local/Overseas Job Opportunity, please specify:'
		},{
			xtype: 'panel',
			layout: 'column',
			items: [{
				columnWidth: .512,
				xtype: 'textfield',
				fieldLabel: 'Industry of Next Employer',
				name: 'industrynxtemp',
				labelAlign: 'top',
				cls: 'field-margin'
			},{
				columnWidth: .488,
				xtype: 'combobox',
				fieldLabel: 'Name of Company (Optional)',
				name: 'companynxtemp',
				labelAlign: 'top',
				cls: 'field-margin',
				store: companylk,
				displayField: 'companyname',
				valueField: 'companycode'
			}]
			
		}]
    },{
        xtype: 'panel',
        title: 'ABOUT YOUR JOB',
        width: '60%',
        flex: 35,
		items: [{
			xtype: 'displayfield',
			width: 500,
			cls: 'field-margin',
			name: 'displayonlysix',
			value: 'Please answer YES or NO. You may elaborate your answers using the space provided.'
		},{
			xtype: 'panel',
			layout: {
				type: 'vbox',
				align: 'center'
			},
			items: [{
				xtype: 'panel',
				width: '100%',
				height: 25,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'displayfield',
					name: 'displayonlyeight',
					value: 'Areas',
					cls: 'field-margin',
					flex: 4
				},{
					xtype: 'displayfield',
					name: 'displayonlynine',
					inputValue: 'Yes',
					cls: 'field-margin',
					flex: 1
				},{
					xtype: 'displayfield',
					name: 'displayonlyten',
					inputValue: 'No',
					flex: 1,
					cls: 'field-margin'
				},{
					xtype: 'displayfield',
					name: 'displayonlyeight',
					value: 'Remarks',
					cls: 'field-margin',
					flex: 4
				}]
			},{
				xtype: 'panel',
				width: '100%',
				height: 50,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'displayfield',
					name: 'displayonlyeleven',
					value: '1.	Did you understand the performance standards you were expected to meet?',
					cls: 'field-margin',
					flex: 4
				},{
					xtype: 'radiofield',
					name: 'expectedtomeet',
					inputValue: 'Yes',
					flex: 1
				},{
					xtype: 'radiofield',
					name: 'expectedtomeet',
					inputValue: 'No',
					checked: true,
					flex: 1
				},{
					xtype: 'textareafield',
					name: 'expectmeetremarks',
					cls: 'field-margin',
					flex: 4
				}]
			},{
				xtype: 'panel',
				width: '100%',
				height: 50,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'displayfield',
					name: 'displayonlytwelve',
					value: '2.	Were you informed about the changes that affected your work?',
					cls: 'field-margin',
					flex: 4
				},{
					xtype: 'radiofield',
					name: 'changesaffected',
					inputValue: 'Yes',
					flex: 1
				},{
					xtype: 'radiofield',
					name: 'changesaffected',
					checked: true,
					inputValue: 'No',
					flex: 1
				},{
					xtype: 'textareafield',
					name: 'changesremarks',
					cls: 'field-margin',
					flex: 4
				}]
			},{
				xtype: 'panel',
				width: '100%',
				height: 50,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'displayfield',
					name: 'displayonlythirteen',
					value: '3.	Do you feel you were given a chance to develop your full potential?',
					cls: 'field-margin',
					flex: 4
				},{
					xtype: 'radiofield',
					name: 'developfull',
					inputValue: 'Yes',
					flex: 1
				},{
					xtype: 'radiofield',
					name: 'developfull',
					checked: true,
					inputValue: 'No',
					flex: 1
				},{
					xtype: 'textareafield',
					name: 'developfullremarks',
					cls: 'field-margin',
					flex: 4
				}]
			},{
				xtype: 'panel',
				width: '100%',
				height: 50,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'displayfield',
					name: 'displayonlyfourteen',
					value: '4.	Was your superior willing to answer questions and help you solve problems?',
					cls: 'field-margin',
					flex: 4
				},{
					xtype: 'radiofield',
					name: 'answerproblems',
					inputValue: 'Yes',
					flex: 1
				},{
					xtype: 'radiofield',
					name: 'answerproblems',
					checked: true,
					inputValue: 'No',
					flex: 1
				},{
					xtype: 'textareafield',
					name: 'problemsremarks',
					cls: 'field-margin',
					flex: 4
				}]
			},{
				xtype: 'panel',
				width: '100%',
				height: 50,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'displayfield',
					name: 'displayonlyfifteen',
					value: '5.	Were you encouraged to offer suggestions and improvements?',
					cls: 'field-margin',
					flex: 4
				},{
					xtype: 'radiofield',
					name: 'improvements',
					inputValue: 'Yes',
					flex: 1
				},{
					xtype: 'radiofield',
					name: 'improvements',
					checked: true,
					inputValue: 'No',
					flex: 1
				},{
					xtype: 'textareafield',
					name: 'improvementsremarks',
					cls: 'field-margin',
					flex: 4
				}]
			}]
		},{
			xtype: 'textareafield',
			name: 'factorsfacilitated',
			fieldLabel: '6. What factor(s) facilitated the accomplishment of your job?',
			labelAlign: 'top',
			width: 600,
			cls: 'field-margin'
		},{
			xtype: 'textareafield',
			name: 'factorshindered',
			fieldLabel: '7. What factor(s) hindered the accomplishment of your job?',
			labelAlign: 'top',
			width: 600,
			cls: 'field-margin'
		}]
    },{
        xtype: 'panel',
        title: 'AREAS FOR IMPROVEMENT', 
        width: '60%',
        flex: 54,
		items: [{
			xtype: 'displayfield',
			name: 'displayonlytwenty',
			value: 'The company appreciates your honest response to find out areas for improvement in the company.  You may elaborate your answers using the space provided.  Please rate each area according to the following:',
			cls: 'field-margin',
			width: 600
		},{
			xtype: 'panel',
			width: '100%',
			layout: {
				type: 'hbox',
				align: 'stretch'
			},
			items: [{
				xtype: 'panel',
				html: '<b>1 - Very Satisfied</b>',
				flex: 1
			},{
				xtype: 'panel',
				html: '<b>2 - Satisfied</b>',
				flex: 1
			},{
				xtype: 'panel',
				html: '<b>3 - Dissatisfied</b>',
				flex: 1
			},{
				xtype: 'panel',
				html: '<b>4 - Very Dissatisfied</b>',
				flex: 1
			}]
		},{
			xtype: 'displayfield',
			value: ' ',
			width: '100%'
		},{
			xtype: 'panel',
			width: '100%',
			layout: {
				type: 'vbox',
				align: 'center'
			},
			items: [{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: 'Areas',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'displayfield',
						value: '1',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'displayfield',
						value: '2',
						checked: true,
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'displayfield',
						value: '3',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'displayfield',
						value: '4',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'displayfield',
						value: 'Remarks',
						width: '100%',
						cls: 'field-margin'
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '1.	Company Policies and Practices',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'comppolicies',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'comppolicies',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'comppolicies',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'comppolicies',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'comppolicyremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '2.	Company Reputation',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'compreputation',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'compreputation',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'compreputation',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'compreputation',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'compreputationremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '3.	Senior Leadership',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'seniorlead',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'seniorlead',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'seniorlead',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'seniorlead',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'seniorleadremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '4.	Immediate Superior',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'superiorimmed',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'superiorimmed',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'superiorimmed',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'superiorimmed',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'superiorimmedremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '5.	Co-workers',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'coworkers',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'coworkers',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'coworkers',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'coworkers',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'coworkersremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '6.	Customers',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'customers',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'customers',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'customers',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'customers',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'customersremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '7.	Salary',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'salary',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'salary',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'salary',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'salary',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'salaryremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '8.	Benefits',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'benefits',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'benefits',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'benefits',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'benefits',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'benefitsremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '9.	Performance Management',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'perfmgnt',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'perfmgnt',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'perfmgnt',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'perfmgnt',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'perfmgntremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '10.	Recognition',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'recognition',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'recognition',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'recognition',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'recognition',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'recognitionremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '11.	Work',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'work',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'work',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'work',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'work',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'workremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '12.	Resources (People, Information, Tools, Technology)',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'resourcespeople',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'resourcespeople',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'resourcespeople',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'resourcespeople',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'resourcespeopleremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '13.	Employee Communication',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'empcommu',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'empcommu',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'empcommu',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'empcommu',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'empcommuremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '14.	Work Processes',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workprocess',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workprocess',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workprocess',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workprocess',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'workprocessremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '15.	Career Opportunities',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'careeropp',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'careeropp',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'careeropp',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'careeropp',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'careeroppremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '16.	Training and Development Opportunities',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'traindevopp',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'traindevopp',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'traindevopp',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'traindevopp',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'traindevoppremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '17.	Work/Life Balance',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'worklifebal',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'worklifebal',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'worklifebal',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'worklifebal',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'worklifebalremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '18.	Working Conditions',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workcondition',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workcondition',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workcondition',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'workcondition',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'workconditionremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			},{
				xtype: 'panel',
				width: '100%',
				flex: 1,
				layout: {
					type: 'hbox',
					align: 'stretch'
				},
				items: [{
					xtype: 'panel',
					flex: 6,
					items: [{
						xtype: 'displayfield',
						value: '19.	Overall Working Experience',
						width: '100%',
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'overallwork',
						inputValue: 1,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'overallwork',
						inputValue: 2,
						checked: true,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'overallwork',
						inputValue: 3,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 1,
					items: [{
						xtype: 'radiofield',
						name: 'overallwork',
						inputValue: 4,
						cls: 'field-margin'
					}]
				},{
					xtype: 'panel',
					flex: 5,
					items: [{
						xtype: 'textfield',
						name: 'overallworkremarks',
						cls: 'field-margin',
						width: 200
					}]
				}]
			}]
		}]
    },{
        xtype: 'panel',
        width: '60%',
        flex: 5,
		layout: {
			type: 'hbox',
			align: 'center'
		},
		items: [{
			xtype: 'displayfield',
			value: 'Are you willing to re-apply in this company in the future?',
			cls: 'field-margin',
			flex: 6
		},{
			xtype: 'radiofield',
			fieldLabel: 'Yes',
			checked: true,
			name: 'applyfutureyes',
			labelAlign: 'top',
			cls: 'field-margin',
			flex: 1
		},{
			xtype: 'radiofield',
			fieldLabel: 'No',
			name: 'applyfutureyes',
			labelAlign: 'top',
			cls: 'field-margin',
			flex: 1
		},{
			xtype: 'textfield',
			fieldLabel: 'Remarks',
			labelAlign: 'top',
			name: 'applyfutureremarks',
			cls: 'field-margin',
			flex: 6
		}]
    },{
        xtype: 'panel',
        width: '60%',
        flex: 12,
		items: [{
			xtype: 'textareafield',
			name: 'remarksfinalresignee',
			fieldLabel: 'Remarks of Resigning Employe',
			labelAlign: 'top',
			cls: 'field-margin',
			width: 600
		},{
			xtype: 'datefield',
			name: 'resigneeremarkdate',
			cls: 'field-margin',
			fieldLabel: 'Date'
		}]
    },{
        xtype: 'panel',
        width: '60%',
        flex: 12,
		items: [{
			xtype: 'textareafield',
			name: 'rmrksfinterviewer',
			fieldLabel: 'Remarks of the Interviewer',
			labelAlign: 'top',
			cls: 'field-margin',
			width: 600
		},{
			xtype: 'datefield',
			name: 'interviewerrmrkdate',
			cls: 'field-margin',
			fieldLabel: 'Date'
		}]
    }],
	buttons: [{
		text: 'Submit Form',
		handler: function() {
		  if (formExit.getForm().isValid()) {
		  	formExit.submit({
		  		url: 'app/controller/test.cfm',
		  		reset: true,
		  		method: 'POST',
		  		waitMsg: 'Submitting Exit Interview form...Please wait...',
		  		failure: function(form, action){
		  			Ext.Msg.show({
		  				title: 'Failed to submit',
		  				msg: 'There is a problem in submitting the exit interview form.' + action.result.form[0].detail,
		  				buttons: Ext.Msg.OK,
		  				icon: Ext.Msg.ERROR
		  			});
		  		},
		  		success: function(form, action){
		  			Ext.Msg.alert('Status', 'Form submitted successfully.');
		  		}
		  	});
		  } else {
		  	        Ext.Msg.show({
		  				title: 'Invalid field value',
		  				msg: 'Please provide correct values for the fields.',
		  				buttons: Ext.Msg.OK,
		  				icon: Ext.Msg.WARNING
		  			});
		  }
		}
	}]
});
});
